var vehicleInfos = [];

$(document).ready(function() {
	showLoading();
	$('title', parent.document).html($('title').text());
	setBaseUrl();
	addTitle("vehicleInfoDetails");
	search();
})

function search(){
	$('#CarNumber').val($("#detailID", parent.document).val());
	$ajax('searchVehicleInfo', 'vehicleSearch', searchVehicleInfo);
	$("#detailID", parent.document).val("");
}

function searchVehicleInfo(data) {
	vehicleInfos = data && data.carInfoList || [];
	createDetailUlBody("detailOneBody", vehicleInfoDetailTable, vehicleInfos[0], 1);
	createDetailUlBody("detailTwoBody", vehicleInfoDetailTable, vehicleInfos[0], 2);
	createDetailUlBody("detailThreeBody", vehicleInfoDetailTable, vehicleInfos[0], 3);
	createDetailUlBody("detailFourBody", vehicleInfoDetailTable, vehicleInfos[0], 4);
	$("#stationName").html('');
	$("#stationName").html(vehicleInfos[0].chargingStationName);
	$("#batteryName").html('<a class="details" onclick=\'batteryType("0")\'>'+vehicleInfos[0].batteryName+'</a>');
	setTimeout(hideLoading, 500);
}
function batteryType(num){
	window.parent.detalisDrop('vehicle/batteryTypeDetail', num, $("#currentPage").val(), "drownDown3", "" ,"carPage" ,"batteryType");
	$("#parentSkipMenu", parent.document).val("chargingStationPage");
	$("#detailID", parent.document).val(vehicleInfos[num].batteryType);
}
function goback() {
	window.parent.skipMenu('vehicle/vehicleInfo', 'drownDown3', '', 'carPage', 'vehicleInfo');
}